<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="./assets/lib/layui/css/layui.css">
    <script src="./assets/lib/layui/layui.all.js"></script>
    <link rel="stylesheet" type="text/css" href="./css/index.css" />
    <title>参与BLUEJ圣诞活动</title>
    <style>
        .avatar{
            margin: 0 auto;
            display: block;
            width: 40vw;
            height: 40vw;
            border-radius: 50%;
        }
    </style>
</head>
<body>
    <!-- 预加载一张图片，js里面点击时用到 -->
		<audio id="music" loop autoplay="autoplay" src="./mp3/MerryChristmas.mp3"></audio>
		<div class="MerryChristmas">
			<div class="qr">
                <img class="avatar" src="" alt="">
                <br>
				<button class=" joinBtn layui-btn layui-btn-primary" >快报名吧!</button>
			</div>
			<div class="logo">
				<img src="./img/MerryChristmas/logo.png" />
			</div>
			<div class="nav">
				<img src="./img/MerryChristmas/nav.png" />
			</div>
			<div class="den">
				<img src="./img/MerryChristmas/xinxin.png" />
			</div>
			<div class="den2">
				<img src="./img/MerryChristmas/denpao.png" />
			</div>
			<div class="shendan">
				<img src="./img/MerryChristmas/shendan.png" />
			</div>
			<div class="xue">
				<img src="./img/MerryChristmas/xuehua.png" />
			</div>
			<div class="denpao">
				<img src="./img/MerryChristmas/tanguo.png" />
			</div>
			<div class="wazhi">
				<img src="./img/MerryChristmas/wazhi.png" />
			</div>
			<div class="xuehua">
				<img src="./img/MerryChristmas/xue.png" />
			</div>
			<div class="qipao">
				<img src="./img/MerryChristmas/qi.png" />
			</div>
			<div class="yezhi">
				<img src="./img/MerryChristmas/yezhi.png" />
			</div>
			<div class="liwu">
				<img src="./img/MerryChristmas/liwu1.png" />
			</div>
			<div class="liwu2">
				<img src="./img/MerryChristmas/liwu2.png" />
			</div>
		</div>
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script src="./js/wx_getInfo.js"></script>
    <script src="./js/utils.js"></script>
    <script>
        document.addEventListener("WeixinJSBridgeReady", function () {
            document.querySelector("audio").play();
        }, false);
        (function(){
            var userInfo = JSON.parse(sessionStorage.getItem("userInfo"))
            console.log(userInfo);
            $(".avatar").attr("src",userInfo.headimgurl);
            $(".joinBtn").html(userInfo.nickname+" 快报名吧!");
            $(".joinBtn").on("click",function(){
				if(!userInfo) {
					layer.alert("授权失败!",{icon: 2});
					location.reload();
					return
				};
				myReq(urls.joinActive,userInfo,"post",function(res){
					layer.alert(res.msg,{icon: 1});
					console.log(res)
				})
            })
        })()
    </script>
</body>
</html>